#pragma once
#include<iostream>
#include<assert.h>

using namespace std;

class Date
{
	friend ostream& operator<<(ostream& out, const Date& d);
	friend istream& operator>>(istream& out, Date& d);

public:
	Date(int year = 1, int month = 1, int day = 1);

	void Print()
	{
		cout << _year << "-" << _month << "-" << _day << endl;
	}

	bool operator<(const Date& d)const;
	bool operator==(const Date& d)const;
	bool operator<=(const Date& d)const;

	bool operator>(const Date& d)const;
	bool operator>=(const Date& d)const;
	bool operator!=(const Date& d)const;

	static int GetMonthDays(int year, int month);
	Date& operator+=(int day);
	Date operator+(int day)const;

	Date& operator++();
	Date operator++(int);

	Date& operator-=(int day);
	Date operator-(int day)const;

	Date& operator--();
	Date operator--(int);

	int operator-(const Date& d)const;


private:
	int _year;
	int _month;
	int _day;
};

ostream& operator<<(ostream& out, const Date& d);
istream& operator>>(istream& out,  Date& d);